package org.springframework.core.annotation;

import java.lang.annotation.Annotation;

public interface AnnotationFilter {

    AnnotationFilter PLAIN = new AnnotationFilter() {
        @Override
        public boolean matches(String typeName) {
            return typeName.startsWith("java.lang") || typeName.startsWith("org.springframework.lang");
        }
    };

    default boolean matches(Annotation annotation) {
        return matches(annotation.annotationType());
    }

    default boolean matches(Class<?> type) {
        return matches(type.getName());
    }

    boolean matches(String typeName);
}
